﻿<!--
//*****************************************************************************
//
//  Silver Games - Checkers
//  Copyright © 2009 Randi Relander
//      <rjrelander@users.sourceforge.net>
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//*****************************************************************************
-->

<UserControl x:Class="Checkers.Client.ProgressSpinner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="CheckersResources.xaml"/>
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

    <Grid x:Name="LayoutRoot" Width="50" Height="50">

        <Canvas>

            <Canvas.RenderTransform>
                <TransformGroup>
                    <RotateTransform x:Name="mRotateTransform" />
                    <TranslateTransform X="25" Y="25" />
                </TransformGroup>
            </Canvas.RenderTransform>

            <Canvas Opacity="1.0">
                
                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="0" />
                    </TransformGroup>
                </Canvas.RenderTransform>
                
                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>
            
            </Canvas>

            <Canvas Opacity="0.9">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-30" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.8">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-60" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>


            <Canvas Opacity="0.7">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-90" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.6">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-120" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.5">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-150" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.4">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-180" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.3">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-210" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.2">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-240" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas Opacity="0.1">

                <Canvas.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform X="-25" Y="-5" />
                        <RotateTransform Angle="-270" />
                    </TransformGroup>
                </Canvas.RenderTransform>

                <Ellipse Width="10" Height="10" Fill="Green" />

                <Ellipse Width="10" Height="10">
                    <Ellipse.Fill>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0" Color="#FF7FFF00"/>
                            <GradientStop Offset="1" Color="#007FFF00"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

            </Canvas>

            <Canvas.Triggers>
                <EventTrigger RoutedEvent="ContentControl.Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation x:Name="mAnimation"
                                Storyboard.TargetName="mRotateTransform"
                                Storyboard.TargetProperty="Angle"
                                From="0" To="360" Duration="0:0:01" RepeatBehavior="Forever" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Canvas.Triggers>

        </Canvas>

    </Grid>

</UserControl>    